package cn.com.fattiger.framework.cms.admin.common.dao;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import cn.com.fattiger.framework.cms.admin.common.model.Question;

public interface QuestionRepository extends PagingAndSortingRepository<Question, Long>, JpaSpecificationExecutor<Question>{

	@Modifying
	@Transactional  
	@Query("update Question q set q.content = ?1,q.sequence = ?2,q.type=?3 where q.id = ?4")
	int update(String content, Integer sequence, Integer type, Long id);
}
